<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<meta name="generator" content="JsDoc Toolkit" />
		
		<title>JsDoc Reference - jamUtils</title>

		<style type="text/css">
			/* default.css */
body
{
	font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
	width: 980px;
}

.header
{
	clear: both;
	background-color: #ccc;
	padding: 8px;
}

h1
{
	font-size: 150%;
	font-weight: bold;
	padding: 0;
	margin: 1em 0 0 .3em;
}

hr
{
	border: none 0;
	border-top: 1px solid #7F8FB1;
	height: 1px;
}

pre.code
{
	display: block;
	padding: 8px;
	border: 1px dashed #ccc;
}

#index
{
	margin-top: 24px;
	float: left;
	width: 160px;
	position: absolute;
	left: 8px;
	background-color: #F3F3F3;
	padding: 8px;
}

#content
{
	margin-left: 190px;
	width: 790px;
}

.classList
{
	list-style-type: none;
	padding: 0;
	margin: 0 0 0 8px;
	font-family: arial, sans-serif;
	font-size: 1em;
	overflow: auto;
}

.classList li
{
	padding: 0;
	margin: 0 0 8px 0;
}

.summaryTable { width: 100%; }

h1.classTitle
{
	font-size:170%;
	line-height:130%;
}

h2 { font-size: 110%; }
caption, div.sectionTitle
{
	background-color: #7F8FB1;
	color: #fff;
	font-size:130%;
	text-align: left;
	padding: 2px 6px 2px 6px;
	border: 1px #7F8FB1 solid;
}

div.sectionTitle { margin-bottom: 8px; }
.summaryTable thead { display: none; }

.summaryTable td
{
	vertical-align: top;
	padding: 4px;
	border-bottom: 1px #7F8FB1 solid;
	border-right: 1px #7F8FB1 solid;
}

/*col#summaryAttributes {}*/
.summaryTable td.attributes
{
	border-left: 1px #7F8FB1 solid;
	width: 140px;
	text-align: right;
}

td.attributes, .fixedFont
{
	line-height: 15px;
	color: #002EBE;
	font-family: "Courier New",Courier,monospace;
	font-size: 13px;
}

.summaryTable td.nameDescription
{
	text-align: left;
	font-size: 13px;
	line-height: 15px;
}

.summaryTable td.nameDescription, .description
{
	line-height: 15px;
	padding: 4px;
	padding-left: 4px;
}

.summaryTable { margin-bottom: 8px; }

ul.inheritsList
{
	list-style: square;
	margin-left: 20px;
	padding-left: 0;
}

.detailList {
	margin-left: 20px; 
	line-height: 15px;
}
.detailList dt { margin-left: 20px; }

.detailList .heading
{
	font-weight: bold;
	padding-bottom: 6px;
	margin-left: 0;
}

.light, td.attributes, .light a:link, .light a:visited
{
	color: #777;
	font-style: italic;
}

.fineprint
{
	text-align: right;
	font-size: 10px;
}
		</style>
	</head>

	<body>
<!-- ============================== header ================================= -->	
		<!-- begin static/header.html -->
		<div id="header">
</div>
		<!-- end static/header.html -->

<!-- ============================== classes index ============================ -->
		<div id="index">
			<!-- begin publish.classesIndex -->
			<div align="center"><a href="../index.html">Class Index</a>
| <a href="../files.html">File Index</a></div>
<hr />
<h2>Classes</h2>
<ul class="classList">
	
	<li><a href="../symbols/jamActions.html">jamActions</a></li>
	
	<li><a href="../symbols/jamEngine.html">jamEngine</a></li>
	
	<li><a href="../symbols/jamHelpers.html">jamHelpers</a></li>
	
	<li><a href="../symbols/jamJSON.html">jamJSON</a></li>
	
	<li><a href="../symbols/jamUtils.html">jamUtils</a></li>
	
</ul>
<hr />
			<!-- end publish.classesIndex -->
		</div>
		
		<div id="content">
<!-- ============================== class title ============================ -->
			<h1 class="classTitle">
				
				Namespace jamUtils
			</h1>

<!-- ============================== class summary ========================== -->			
			<p class="description">
				<br />Version
					3.3.<br />
				
				
			
				
				
				
					<br /><i>Defined in: </i> <a href="../symbols/src/jamUtils.jsxinc.html">jamUtils.jsxinc</a>.
				
			</p>

<!-- ============================== constructor summary ==================== -->			
			
			<table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class jamUtils.">
				<caption>Namespace Summary</caption>
				<thead>
					<tr>
						<th scope="col">Constructor Attributes</th>
						<th scope="col">Constructor Name and Description</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td class="attributes">&nbsp;</td>
						<td class="nameDescription" >
							<div class="fixedFont">
								<b><a href="../symbols/jamUtils.html#constructor">jamUtils</a></b>
							</div>
							<div class="description">Global object (used to simulate a namespace in JavaScript) containing
a set of utility functions for scripts written with the
<a href="http://www.tonton-pixel.com/blog/json-action-manager/">JSON Action Manager</a> engine.</div>
						</td>
					</tr>
				</tbody>
			</table>
			

<!-- ============================== properties summary ===================== -->
			

<!-- ============================== methods summary ======================== -->
			
				
				
				<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class jamUtils.">
					<caption>Method Summary</caption>
					<thead>
						<tr>
							<th scope="col">Method Attributes</th>
							<th scope="col">Method Name and Description</th>
						</tr>
					</thead>
					<tbody>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">jamUtils.<b><a href="../symbols/jamUtils.html#.cloneData">cloneData</a></b>(data)
								</div>
								<div class="description">Get a clone (deep copy) of a Javascript data structure.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">jamUtils.<b><a href="../symbols/jamUtils.html#.dataToHexaString">dataToHexaString</a></b>(dataString)
								</div>
								<div class="description">Convert a raw byte data string into a hexadecimal string.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">jamUtils.<b><a href="../symbols/jamUtils.html#.eraseCustomOptions">eraseCustomOptions</a></b>(signature)
								</div>
								<div class="description">Erase custom options associated with a unique signature [available in CS3 or later].</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">jamUtils.<b><a href="../symbols/jamUtils.html#.fontExists">fontExists</a></b>(fontPostScriptName)
								</div>
								<div class="description">Test if a required font is available.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">jamUtils.<b><a href="../symbols/jamUtils.html#.fromDistanceUnit">fromDistanceUnit</a></b>(amount, amountBasePerInch)
								</div>
								<div class="description">Convert a distance from "distanceUnit" units to pixels.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">jamUtils.<b><a href="../symbols/jamUtils.html#.getCustomOptions">getCustomOptions</a></b>(signature, defaultOptions)
								</div>
								<div class="description">Retrieve custom options associated with a unique signature [available in CS3 or later].</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">jamUtils.<b><a href="../symbols/jamUtils.html#.hexaToDataString">hexaToDataString</a></b>(hexaString)
								</div>
								<div class="description">Convert a hexadecimal string into a raw byte data string.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">jamUtils.<b><a href="../symbols/jamUtils.html#.loadAction">loadAction</a></b>(action, actionSet, actionsFilePath)
								</div>
								<div class="description">Load an action if not currently available.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">jamUtils.<b><a href="../symbols/jamUtils.html#.loadActionSet">loadActionSet</a></b>(actionSet, actionsFilePath)
								</div>
								<div class="description">Load an action set if not currently available.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">jamUtils.<b><a href="../symbols/jamUtils.html#.loadPreset">loadPreset</a></b>(presetProperty, presetName, presetFilePath)
								</div>
								<div class="description">Load a preset if not currently available.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">jamUtils.<b><a href="../symbols/jamUtils.html#.putCustomOptions">putCustomOptions</a></b>(signature, customOptions, persistent)
								</div>
								<div class="description">Save custom options associated with a unique signature [available in CS3 or later].</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">jamUtils.<b><a href="../symbols/jamUtils.html#.readJsonFile">readJsonFile</a></b>(jsonFile)
								</div>
								<div class="description">Convert a JSON text file into a JavaScript data structure.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">jamUtils.<b><a href="../symbols/jamUtils.html#.toDistanceUnit">toDistanceUnit</a></b>(amount, amountBasePerInch)
								</div>
								<div class="description">Convert a distance in pixels to "distanceUnit" units.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">jamUtils.<b><a href="../symbols/jamUtils.html#.writeJsonFile">writeJsonFile</a></b>(jsonFile, data, space)
								</div>
								<div class="description">Convert a JavaScript data structure into a JSON text file.</div>
							</td>
						</tr>
					
					</tbody>
				</table>
				
				
				
			
<!-- ============================== events summary ======================== -->
			

<!-- ============================== constructor details ==================== -->		
			
			<div class="details"><a name="constructor"> </a>
				<div class="sectionTitle">
					Namespace Detail
				</div>
				
				<div class="fixedFont">
						<b>jamUtils</b>
				</div>
				
				<div class="description">
					Global object (used to simulate a namespace in JavaScript) containing
a set of utility functions for scripts written with the
<a href="http://www.tonton-pixel.com/blog/json-action-manager/">JSON Action Manager</a> engine.
					<br /><i>Author: </i>Michel MARIANI.
				</div>
				
				
				
				
					
					
					
					
					
					
					

			</div>
			

<!-- ============================== field details ========================== -->		
			

<!-- ============================== method details ========================= -->		
			
				<div class="sectionTitle">
					Method Detail
				</div>
				
					<a name=".cloneData"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					<span class="light">{Object|Array|String|Number|Boolean|Null}</span>
					<span class="light">jamUtils.</span><b>cloneData</b>(data)
					
					</div>
					<div class="description">
						Get a clone (deep copy) of a Javascript data structure.
						
						
					</div>
					
					
					
					<pre class="code">var customOptions;
var defaultOptions =
{
    dialog:
    {
        x: 0,
        y: 0,
        width: 1024,
        height: 768
    }
};
//
customOptions = jamUtils.<strong>cloneData</strong> (defaultOptions);
customOptions.dialog.width = 512;
alert (defaultOptions.dialog.width);   // -&gt; 1024
//
customOptions = defaultOptions;
customOptions.dialog.width = 512;
alert (defaultOptions.dialog.width);   // -&gt; 512</pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{Object|Array|String|Number|Boolean|Null}</span> <b>data</b>
									
								</dt>
								<dd>Javascript data structure</dd>
							
							</dl>
						
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{Object|Array|String|Number|Boolean|Null}</span> Clone (deep copy) of a Javascript data structure</dd>
							
							</dl>
						
						
						

					<hr />
				
					<a name=".dataToHexaString"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					<span class="light">{String}</span>
					<span class="light">jamUtils.</span><b>dataToHexaString</b>(dataString)
					
					</div>
					<div class="description">
						Convert a raw byte data string into a hexadecimal string.
						
						
					</div>
					
					
					
					<pre class="code">var hexaString = jamUtils.<strong>dataToHexaString</strong> ("«Íï"); // -> "ABCDEF"</pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>dataString</b>
									
								</dt>
								<dd>Raw byte data string</dd>
							
							</dl>
						
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{String}</span> Hexadecimal string</dd>
							
							</dl>
						
						
						
							<dl class="detailList">
							<dt class="heading">See:</dt>
							
								<dd><a href="../symbols/jamUtils.html#.hexaToDataString">jamUtils.hexaToDataString</a></dd>
							
							</dl>
						

					<hr />
				
					<a name=".eraseCustomOptions"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					
					<span class="light">jamUtils.</span><b>eraseCustomOptions</b>(signature)
					
					</div>
					<div class="description">
						Erase custom options associated with a unique signature [available in CS3 or later].
						
						
					</div>
					
					
					
					<pre class="code">var signature = "unique-signature-custom-options";
jamUtils.<strong>eraseCustomOptions</strong> (signature);</pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>signature</b>
									
								</dt>
								<dd>Unique signature string</dd>
							
							</dl>
						
						
						
						
						
						
						
							<dl class="detailList">
							<dt class="heading">See:</dt>
							
								<dd><a href="../symbols/jamUtils.html#.getCustomOptions">jamUtils.getCustomOptions</a></dd>
							
								<dd><a href="../symbols/jamUtils.html#.putCustomOptions">jamUtils.putCustomOptions</a></dd>
							
							</dl>
						

					<hr />
				
					<a name=".fontExists"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					<span class="light">{Boolean}</span>
					<span class="light">jamUtils.</span><b>fontExists</b>(fontPostScriptName)
					
					</div>
					<div class="description">
						Test if a required font is available.
						
						
					</div>
					
					
					
					<pre class="code">if (jamUtils.<strong>fontExists</strong> ("Apple-Chancery"))
{
    // Use the fancy Apple Chancery font...
}</pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>fontPostScriptName</b>
									
								</dt>
								<dd>Font PostScript name string</dd>
							
							</dl>
						
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{Boolean}</span> Font found boolean</dd>
							
							</dl>
						
						
						

					<hr />
				
					<a name=".fromDistanceUnit"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					<span class="light">{Number}</span>
					<span class="light">jamUtils.</span><b>fromDistanceUnit</b>(amount, amountBasePerInch)
					
					</div>
					<div class="description">
						Convert a distance from "distanceUnit" units to pixels.
						
						
					</div>
					
					
					
					<pre class="code">jamEngine.meaningfulIds = true;
var resultDescObj = jamEngine.jsonGet ([ { "document": { "&lt;enumerated&gt;": { "ordinal": "first" } } } ]);
var width = resultDescObj["width"]["&lt;unitDouble&gt;"]["distanceUnit"];
var height = resultDescObj["height"]["&lt;unitDouble&gt;"]["distanceUnit"];
var resolution = resultDescObj["resolution"]["&lt;unitDouble&gt;"]["densityUnit"];
var pixelsWidth = jamUtils.<strong>fromDistanceUnit</strong> (width, resolution);
var pixelsHeight = jamUtils.<strong>fromDistanceUnit</strong> (height, resolution);</pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{Number}</span> <b>amount</b>
									
								</dt>
								<dd>Distance in "distanceUnit" units (special pixels units at an absolute 72 dpi)</dd>
							
								<dt>
									<span class="light fixedFont">{Number}</span> <b>amountBasePerInch</b>
									
								</dt>
								<dd>Resolution of document in pixels per inch</dd>
							
							</dl>
						
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{Number}</span> Distance in pixels</dd>
							
							</dl>
						
						
						
							<dl class="detailList">
							<dt class="heading">See:</dt>
							
								<dd><a href="../symbols/jamUtils.html#.toDistanceUnit">jamUtils.toDistanceUnit</a></dd>
							
							</dl>
						

					<hr />
				
					<a name=".getCustomOptions"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					<span class="light">{Object}</span>
					<span class="light">jamUtils.</span><b>getCustomOptions</b>(signature, defaultOptions)
					
					</div>
					<div class="description">
						Retrieve custom options associated with a unique signature [available in CS3 or later].
						
						
					</div>
					
					
					
					<pre class="code">var signature = "unique-signature-custom-options";
jamUtils.eraseCustomOptions (signature);
var customOptions = { name: "Rectangle" };
jamUtils.putCustomOptions (signature, customOptions, true);
var defaultOptions = { width: 1024, height: 768, name: "Untitled" };
customOptions = jamUtils.<strong>getCustomOptions</strong> (signature, defaultOptions);
if (customOptions.name !== "Untitled")
{
    alert (jamJSON.stringify (customOptions.name + "-" + customOptions.width + "x" + customOptions.height));
    // -> "Rectangle-1024x768"
}</pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>signature</b>
									
								</dt>
								<dd>Unique signature string</dd>
							
								<dt>
									<span class="light fixedFont">{Object}</span> <b>defaultOptions</b>
									
								</dt>
								<dd>Default options as a JavaScript literal object</dd>
							
							</dl>
						
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{Object}</span> Custom options as a JavaScript literal object</dd>
							
							</dl>
						
						
						
							<dl class="detailList">
							<dt class="heading">See:</dt>
							
								<dd><a href="../symbols/jamUtils.html#.eraseCustomOptions">jamUtils.eraseCustomOptions</a></dd>
							
								<dd><a href="../symbols/jamUtils.html#.putCustomOptions">jamUtils.putCustomOptions</a></dd>
							
							</dl>
						

					<hr />
				
					<a name=".hexaToDataString"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					<span class="light">{String}</span>
					<span class="light">jamUtils.</span><b>hexaToDataString</b>(hexaString)
					
					</div>
					<div class="description">
						Convert a hexadecimal string into a raw byte data string.
						
						
					</div>
					
					
					
					<pre class="code">var dataString = jamUtils.<strong>hexaToDataString</strong> ("00011E1F20217E7F80819E9FA0A1FEFF");
// -> "\u0000\u0001\u001E\u001F !~\u007F\u0080\u0081\u009E\u009F ¡þÿ"</pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>hexaString</b>
									
								</dt>
								<dd>Hexadecimal string</dd>
							
							</dl>
						
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{String}</span> Raw byte data string</dd>
							
							</dl>
						
						
						
							<dl class="detailList">
							<dt class="heading">See:</dt>
							
								<dd><a href="../symbols/jamUtils.html#.dataToHexaString">jamUtils.dataToHexaString</a></dd>
							
							</dl>
						

					<hr />
				
					<a name=".loadAction"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					
					<span class="light">jamUtils.</span><b>loadAction</b>(action, actionSet, actionsFilePath)
					
					</div>
					<div class="description">
						Load an action if not currently available.
						
						
					</div>
					
					
					
					<pre class="code">Folder.current = new Folder ("~/JSON Action Manager/tests/resources/");
jamUtils.<strong>loadAction</strong> ("Cross Process 2", "Cross Processing", "Cross Processing.atn");</pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>action</b>
									
								</dt>
								<dd>Action name string</dd>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>actionSet</b>
									
								</dt>
								<dd>Action set name string</dd>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>actionsFilePath</b>
									
								</dt>
								<dd>Actions file path string</dd>
							
							</dl>
						
						
						
						
						
						
						

					<hr />
				
					<a name=".loadActionSet"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					
					<span class="light">jamUtils.</span><b>loadActionSet</b>(actionSet, actionsFilePath)
					
					</div>
					<div class="description">
						Load an action set if not currently available.
						
						
					</div>
					
					
					
					<pre class="code">Folder.current = new Folder ("~/JSON Action Manager/tests/resources/");
jamUtils.<strong>loadActionSet</strong> ("Cross Processing", "Cross Processing.atn");</pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>actionSet</b>
									
								</dt>
								<dd>Action set name string</dd>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>actionsFilePath</b>
									
								</dt>
								<dd>Actions file path string</dd>
							
							</dl>
						
						
						
						
						
						
						

					<hr />
				
					<a name=".loadPreset"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					
					<span class="light">jamUtils.</span><b>loadPreset</b>(presetProperty, presetName, presetFilePath)
					
					</div>
					<div class="description">
						Load a preset if not currently available.
						
						
					</div>
					
					
					
					<pre class="code">Folder.current = new Folder ("~/JSON Action Manager/tests/resources/");
jamUtils.<strong>loadPreset</strong> ("style", "Logo X-Aqua in Blue Glass (Button)", "Logo-X-Aqua.asl");
jamUtils.<strong>loadPreset</strong> ("toolPreset", "Brush Tool Soft Round 35 Red", "Brush-35-Red.tpl");</pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>presetProperty</b>
									
								</dt>
								<dd>Preset property string:<br />
<ul>
<li>"brush"</li>
<li>"colors"</li>
<li>"gradientClassEvent"</li>
<li>"style"</li>
<li>"pattern"</li>
<li>"shapingCurve"</li>
<li>"customShape"</li>
<li>"toolPreset"</li>
</ul></dd>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>presetName</b>
									
								</dt>
								<dd>Preset name string</dd>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>presetFilePath</b>
									
								</dt>
								<dd>Preset file path string</dd>
							
							</dl>
						
						
						
						
						
						
						

					<hr />
				
					<a name=".putCustomOptions"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					
					<span class="light">jamUtils.</span><b>putCustomOptions</b>(signature, customOptions, persistent)
					
					</div>
					<div class="description">
						Save custom options associated with a unique signature [available in CS3 or later].
						
						
					</div>
					
					
					
					<pre class="code">var signature = "unique-signature-custom-options";
var customOptions = { width: 512, height: 512, name: "Square" };
jamUtils.<strong>putCustomOptions</strong> (signature, customOptions, true);</pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>signature</b>
									
								</dt>
								<dd>Unique signature string</dd>
							
								<dt>
									<span class="light fixedFont">{Object}</span> <b>customOptions</b>
									
								</dt>
								<dd>Custom options as a JavaScript literal object</dd>
							
								<dt>
									<span class="light fixedFont">{Boolean}</span> <b>persistent</b>
									<i>Optional</i>
								</dt>
								<dd>Whether the options should persist once the script has finished</dd>
							
							</dl>
						
						
						
						
						
						
						
							<dl class="detailList">
							<dt class="heading">See:</dt>
							
								<dd><a href="../symbols/jamUtils.html#.eraseCustomOptions">jamUtils.eraseCustomOptions</a></dd>
							
								<dd><a href="../symbols/jamUtils.html#.getCustomOptions">jamUtils.getCustomOptions</a></dd>
							
							</dl>
						

					<hr />
				
					<a name=".readJsonFile"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					<span class="light">{Object|Array|String|Number|Boolean|Null}</span>
					<span class="light">jamUtils.</span><b>readJsonFile</b>(jsonFile)
					
					</div>
					<div class="description">
						Convert a JSON text file into a JavaScript data structure.
						
						
					</div>
					
					
					
					<pre class="code">var data = jamUtils.<strong>readJsonFile</strong> ("~/Desktop/test-data.json");
alert ("color: " + jamJSON.stringify (data["color"]));   // -> color: [ "RGBColor", [ 255, 0, 255 ] ]</pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{String|Object}</span> <b>jsonFile</b>
									
								</dt>
								<dd>JSON text file path string (or File object)</dd>
							
							</dl>
						
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{Object|Array|String|Number|Boolean|Null}</span> JavaScript data structure (usually an object or array)</dd>
							
							</dl>
						
						
						
							<dl class="detailList">
							<dt class="heading">See:</dt>
							
								<dd><a href="../symbols/jamUtils.html#.writeJsonFile">jamUtils.writeJsonFile</a></dd>
							
							</dl>
						

					<hr />
				
					<a name=".toDistanceUnit"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					<span class="light">{Number}</span>
					<span class="light">jamUtils.</span><b>toDistanceUnit</b>(amount, amountBasePerInch)
					
					</div>
					<div class="description">
						Convert a distance in pixels to "distanceUnit" units.
						
						
					</div>
					
					
					
					<pre class="code">jamEngine.jsonPlay
(
    "make",
    {
        "new":
        {
            "&lt;object&gt;":
            {
                "document":
                {
                    "name": { "&lt;string&gt;": "Polaroid 4x5 Inch (Print)" },
                    "mode": { "&lt;class&gt;": "RGBColorMode" },
                    "width":
                    {
                        "&lt;unitDouble&gt;":
                        {
                            "distanceUnit": jamUtils.<strong>toDistanceUnit</strong> (4 * 300, 300)
                        }
                    },
                    "height":
                    {
                        "&lt;unitDouble&gt;":
                        {
                            "distanceUnit": jamUtils.<strong>toDistanceUnit</strong> (5 * 300, 300)
                        }
                    },
                    "resolution": { "&lt;unitDouble&gt;": { "densityUnit": 300 } },
                    "depth": { "&lt;integer&gt;": 16 },
                    "fill": { "&lt;enumerated&gt;": { "fill": "white" } },
                    "profile": { "&lt;string&gt;": "Adobe RGB (1998)" }
                }
            }
        }
    }
);</pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{Number}</span> <b>amount</b>
									
								</dt>
								<dd>Distance in pixels</dd>
							
								<dt>
									<span class="light fixedFont">{Number}</span> <b>amountBasePerInch</b>
									
								</dt>
								<dd>Resolution of document in pixels per inch</dd>
							
							</dl>
						
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{Number}</span> Distance in "distanceUnit" units (special pixels units at an absolute 72 dpi)</dd>
							
							</dl>
						
						
						
							<dl class="detailList">
							<dt class="heading">See:</dt>
							
								<dd><a href="../symbols/jamUtils.html#.fromDistanceUnit">jamUtils.fromDistanceUnit</a></dd>
							
							</dl>
						

					<hr />
				
					<a name=".writeJsonFile"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					
					<span class="light">jamUtils.</span><b>writeJsonFile</b>(jsonFile, data, space)
					
					</div>
					<div class="description">
						Convert a JavaScript data structure into a JSON text file.
						
						
					</div>
					
					
					
					<pre class="code">var magenta = [ "RGBColor", [ 255, 0, 255 ] ];
var data =
{
    "width": 640,
    "height": 480,
    "color": magenta,
    "title": "紅紫色" + "／" + "マゼンタ"
};
jamUtils.<strong>writeJsonFile</strong> ("~/Desktop/test-data.json", data);</pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{String|Object}</span> <b>jsonFile</b>
									
								</dt>
								<dd>JSON text file path string (or File object)</dd>
							
								<dt>
									<span class="light fixedFont">{Object|Array|String|Number|Boolean|Null}</span> <b>data</b>
									
								</dt>
								<dd>JavaScript data structure (usually an object or array)</dd>
							
								<dt>
									<span class="light fixedFont">{String|Number}</span> <b>space</b>
									<i>Optional</i>
								</dt>
								<dd>Indent space string (e.g. "\t") or number of spaces</dd>
							
							</dl>
						
						
						
						
						
						
						
							<dl class="detailList">
							<dt class="heading">See:</dt>
							
								<dd><a href="../symbols/jamUtils.html#.readJsonFile">jamUtils.readJsonFile</a></dd>
							
							</dl>
						

					
				
			
			
<!-- ============================== event details ========================= -->		
			
			
			<hr />
		</div>

		
<!-- ============================== footer ================================= -->
		<div class="fineprint" style="clear:both">
			
			Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Mon Nov 12 2012 16:48:03 GMT+0100 (CET)
		</div>
	</body>
</html>
